home *** CD-ROM | disk | FTP | other *** search
MarxMenu script | 1991-04-12 | 21.6 KB | 638 lines |
- Comment
- ========================================================================
-
- Novell to MarxMenu Translator:
-
- Copyright 1989-91 by Marc Perkel * All rights reserved.
-
- Usage: MARXMENU NOVTRANS <novell menu>
-
- This program was written to translate Novell menus to MarxMenus. It is
- not an exact translation, but does the bulk of the work. It is up to you
- to edit the output file and tune the menu the way you want.
-
- I have made no attempt to copy color information. I am not presenting
- selections in sorted order, but in the order in which they are defined.
-
- The program creates a MarxMenu file names <menu>.TMP where <menu> is the
- name of your Novell menu file. Then it compiles <menu>.TMP into
- <menu>.MRX file that should be ready to run. if the menu needs to be
- altered, you will have to rename the <menu>.TMP file to a MNU file and
- then you can work with it like any other MarxMenu source file.
-
- ========================================================================
- EndComment
-
- Var
- NovLines Menus Tmp MenuPtr ChoicePtr CommandPtr LinePtr
- BoxDim X Y Z VarNum PromptLine Out Cap InputAVar NovellFileName
- MarxMenuFileName NovellTempFileName
-
- ;------ Translator Messages
-
- Const
- TopMessage = "Joe Blow's Master Menu"
- BottomMessage = "*-<< Acme Manufacturing Company >>-*"
-
- ;------ Array Positions
-
- Qualifier MenuName YPos XPos MenuColor MenuChoices
- Qualifier ChoiceName ChoiceCmd
-
- Comment
- ========================================================================
-
- This is the main body of the NovTrans Program.
-
- ========================================================================
- EndComment
-
- if not NetWorkVersion
- ClearScreen
- Writeln
- Writeln 'This translator requires the network version of MarxMenu to Run!'
- endif
-
- PreAmble
- PrepareFiles
- Header
- Parse
- WriteOutMenus
- WriteOutProcedures
- UseCommand Yes
- ClearScreenFirst No
- Execute 'MARXCOMP.EXE ' + MarxMenuFileName
-
- Writeln
- Writeln 'Done!'
-
- Comment
- =====================================
-
- Subroutine area.
-
- =====================================
- EndComment
-
- ;----- Initilize Variables and Environment
-
- Procedure PreAmble
- ClearScreenOnExit Off
- StandardIO
- Writeln
- NovellFileName = UpperCase(ParamStr(2))
- Usage
- EndProc
-
- ;------ Proper Usage Procedure
-
- Procedure Usage
- if NovellFileName = ''
- Writeln('Usage: MarxMenu NovTrans <menu>')
- Writeln('Converts Novell menus to MarxMenus.')
- Writeln('Be sure to backup your original menus before running!!')
- ExitMenu
- endif
- EndProc
-
- ;----- Create FileNames and open Files
-
- Procedure PrepareFiles
- if pos('.',NovellFileName) > 0
- NovellFileName = left(NovellFileName,pred(pos('.',NovellFileName)))
- endif
-
- NovellTempFileName = NovellFileName + '.MNU'
- MarxMenuFileName = ForceExtension(NovellTempFileName,'TMP')
-
- ReadTextFile NovellTempFileName NovLines
- Writeln 'Creating ' MarxMenuFileName
-
- FileAssign(Out,MarxMenuFileName)
- FileCreate(Out)
- EndProc
-
-
- Procedure BlankLine
- FileWriteln(Out,'')
- EndProc
-
- ;----- Write out the MarxMenu Source Header
-
- Procedure Header
- FileWriteln(Out,'Comment')
- FileWriteln(Out,'==========================================================')
- BlankLine
- FileWriteln(Out,'This File was converted from Novell Menu: ',NovellTempFileName)
- BlankLine
- FileWriteln(Out,'It should behave in a similar way to the original menu but')
- FileWriteln(Out,'not necessarilly exactly the same. It will be close enough')
- FileWriteln(Out,'for you to fine tune it the way you want.')
- BlankLine
- FileWriteln(Out,'To add a choice to a menu simply create another array element')
- FileWriteln(Out,'to Choices, then add the appropiate Onkey statement.')
- FileWriteln(Out,'The menu will make the size adjustments accordinaly.')
- BlankLine
- FileWriteln(Out,' Example:')
- FileWriteln(Out,' Choices[10] = "Print Console" ')
- FileWriteln(Out,' ... ')
- FileWriteln(Out,' ... ')
- FileWriteln(Out,' OnKey "K" ')
- FileWriteln(Out,' PConsole ')
- FileWriteln(Out,' ...')
- BlankLine
- FileWriteln(Out,"If you want to change the menu's center, pass the XY")
- FileWriteln(Out,"coordinates to menu's MakeBox() procedure.")
- BlankLine
- FileWriteln(Out,' Example:')
- FileWriteln(Out,' MakeBox("Menu Header",10,10,CenterXY)')
- BlankLine
- FileWriteln(Out,'This will cause the menu to center at Col 10, Row 10')
- BlankLine
- FileWriteln(Out,'Once you are satisfied with the translation you can copy the TMP file')
- FileWriteln(Out,'over the old Novell MNU file and just work with the MarxMenu version.')
- BlankLine
- FileWriteln(Out,'=========================================================')
- FileWriteln(Out,'EndComment')
- BlankLine
- FileWriteln(Out,';------ Create Variables')
- BlankLine
- FileWriteln(Out,'var')
- FileWriteln(Out,' VertLine = "┬│││││││││││││││││││││││││││││││││││││││││││││"')
- FileWriteln(Out,' %NovVar1 %NovVar2 %NovVar3 %NovVar4 %NovVar5')
- FileWriteln(Out,' %NovVar6 %NovVar7 %NovVar8 %NovVar9 %NovVar10')
- FileWriteln(Out,' Choices')
- FileWriteln(Out,' MenuTitle')
- FileWriteln(Out,' StatusLineText')
- BlankLine
- FileWriteln(Out,';----- Color Variables')
- BlankLine
- FileWriteln(Out,'var')
- FileWriteln(Out,' BackGroundFG BackGroundBG')
- FileWriteln(Out,' TitleBoxBorderFG TitleBoxBG')
- FileWriteln(Out,' TitleBoxInsideFG')
- FileWriteln(Out,' ClockColorFG')
- FileWriteln(Out,' StatusLineFG StatusLineBG')
- FileWriteln(Out,' MenuInsideFG MenuBG')
- FileWriteln(Out,' MenuHeaderFG')
- FileWriteln(Out,' MenuBorderFG')
- FileWriteln(Out,' MenuVertLinesFG')
- FileWriteln(Out,' MenuInverseFG MenuInverseBG')
- FileWriteln(Out,' MenuCapColorFG')
- BlankLine
- FileWriteln(Out,';------ Create Constants')
- BlankLine
- FileWriteln(Out,'Const')
- FileWriteln(Out,' CornerXY = 1')
- FileWriteln(Out,' CenterXY = 0')
- BlankLine
- FileWriteln(Out,';------ Here is where you add you own menu title and status line message')
- BlankLine
- FileWriteln(Out,'MenuTitle = "',TopMessage,'"')
- FileWriteln(Out,'StatusLineText = "',BottomMessage,'"')
- BlankLine
- FileWriteln(Out,'SavePosition On')
- BlankLine
- FileWriteln(Out,';------ This is where you can change the colors to suit your taste.')
- BlankLine
- FileWriteln(Out,'if ColorScreen')
- FileWriteln(Out,' BackGroundFG = Cyan')
- FileWriteln(Out,' BackGroundBG = Blue')
- FileWriteln(Out,' TitleBoxBG = Brown')
- FileWriteln(Out,' TitleBoxBorderFG = White')
- FileWriteln(Out,' TitleBoxInsideFG = Yellow')
- FileWriteln(Out,' ClockColorFG = Yellow')
- FileWriteln(Out,' StatusLineFG = Yellow')
- FileWriteln(Out,' StatusLineBG = Mag')
- FileWriteln(Out,' MenuBG = Blue')
- FileWriteln(Out,' MenuInsideFG = Yellow')
- FileWriteln(Out,' MenuBorderFG = Yellow')
- FileWriteln(Out,' MenuHeaderFG = LCyan')
- FileWriteln(Out,' MenuVertLinesFG = LGreen')
- FileWriteln(Out,' MenuInverseFG = White')
- FileWriteln(Out,' MenuInverseBG = Mag')
- FileWriteln(Out,' MenuCapColorFG = White')
- FileWriteln(Out,'else')
- FileWriteln(Out,' BackGroundFG = Grey')
- FileWriteln(Out,' BackGroundBG = Black')
- FileWriteln(Out,' TitleBoxBG = Grey')
- FileWriteln(Out,' TitleBoxBorderFG = Black')
- FileWriteln(Out,' TitleBoxInsideFG = Black')
- FileWriteln(Out,' ClockColorFG = Black')
- FileWriteln(Out,' StatusLineFG = Black')
- FileWriteln(Out,' StatusLineBG = Grey')
- FileWriteln(Out,' MenuBG = Black')
- FileWriteln(Out,' MenuInsideFG = Grey')
- FileWriteln(Out,' MenuBorderFG = Grey')
- FileWriteln(Out,' MenuHeaderFG = White')
- FileWriteln(Out,' MenuVertLinesFG = White')
- FileWriteln(Out,' MenuInverseFG = Black')
- FileWriteln(Out,' MenuInverseBG = Grey')
- FileWriteln(Out,' MenuCapColorFG = White')
- FileWriteln(Out,'endif')
- BlankLine
- FileWriteln(Out,';------ Clear the screen with a textured background')
- BlankLine
- FileWriteln(Out,'TextColor BackGroundFG BackGroundBG')
- FileWriteln(Out,'ClearScreen 176')
- BlankLine
- FileWriteln(Out,';------ Draw Status Line')
- BlankLine
- FileWriteln(Out,'GotoXY(1,ScreenHeight)')
- FileWriteln(Out,'TextColor(StatusLineFG,StatusLineBG)')
- FileWriteln(Out,'ClearLine')
- FileWriteln(Out,'WriteCenter(StatusLineText)')
- BlankLine
- FileWriteln(Out,';------ Draw the Title Box')
- BlankLine
- FileWriteln(Out,'SingleLineBox')
- FileWriteln(Out,'Explode Off')
- FileWriteln(Out,'BoxInsideColor TitleBoxInsideFG TitleBoxBG')
- FileWriteln(Out,'BoxBorderColor TitleBoxBorderFG TitleBoxBG')
- FileWriteln(Out,'DrawBox 1 1 ScreenWidth 3')
- FileWriteln(Out,'GotoXY(ScreenWidth - Length(MenuTitle) - 3,1)')
- FileWriteln(Out,'Write MenuTitle')
- BlankLine
- FileWriteln(Out,';------ Display the clock')
- BlankLine
- FileWriteln(Out,'ClockColor ClockColorFG TitleBoxBG')
- FileWriteln(Out,'ClockPos 3 2')
- BlankLine
- FileWriteln(Out,';------ Set up the blank screen message if you want one.')
- BlankLine
- FileWriteln(Out,'BlankMessage = ""')
- BlankLine
- FileWriteln(Out,';------ Change BlankTime to 0 if you do not want to blank the screen.')
- BlankLine
- FileWriteln(Out,'BlankTime = 10')
- BlankLine
- FileWriteln(Out,';------ Change LogoffTime to 0 if you do not want timed Logoff.')
- BlankLine
- FileWriteln(Out,'LogoffTime = 60')
- BlankLine
- FileWriteln(Out,'Comment')
- FileWriteln(Out,'=================================')
- BlankLine
- FileWriteln(Out,'Here is where menus are created.')
- BlankLine
- FileWriteln(Out,'=================================')
- FileWriteln(Out,'EndComment')
- BlankLine
- FileFlush(Out);
- EndProc
-
-
- ;----- Delete all spaces in a string to make them a valid MarxMenu label
- ; Returns a string
-
- Procedure DeleteSpaces(St)
- while Pos(' ',St) > 0
- Delete(St,Pos(' ',St),1)
- endwhile
- while Pos('-',St) > 0
- Delete(St,Pos('-',St),1)
- endwhile
- while Pos('.',St) > 0
- Delete(St,Pos('.',St),1)
- endwhile
- if (Mid(St,2,1) >= '0') and (Mid(St,2,1) <= '9')
- Insert('X',St,2)
- endif
- Return St
- EndProc
-
- ;----- Parse Novell Source into MenuName, MenuChoices, MenuCommands
- ;----- Returns a integer pointing to the end of the menu prompt
-
- Procedure FindEndOfMenuPrompt(St)
- Var CommaPos Tail
-
- CommaPos = Pos(',',St)
- if CommaPos = 0 Then Return Length(St) + 1
- Tail = Mid(St,CommaPos + 1,255)
- loop(Length(Tail))
- if Pos(Mid(Tail,LoopIndex,1), '0123456789,') = 0
- Writeln
- Writeln('Error : There must not be any embedded commas in menu title!')
- Writeln(St)
- Writeln
- ExitMenu
- endif
- endloop
- Return CommaPos
- EndProc
-
- ;------ Preprocess Lines
-
- Procedure Parse
- Var TotalLines
- TotalLines = NumberOfElements(NovLines)
- Writeln('Parsing Novell Menu source code ...')
- MenuPtr = 0
- loop(TotalLines)
- if (LoopIndex Mod 10 = 0) or (LoopIndex = TotalLines)
- GotoXY(1,WhereY)
- Write('Processing Line # ',LoopIndex,' of ',TotalLines)
- ClearLine
- endif
- if left(NovLines[LoopIndex],1) = '%'
- ChoicePtr = 0
- CommandPtr = 0
- MenuPtr = MenuPtr + 1
- Tmp = mid(NovLines[LoopIndex],2,255)
- X = FindEndOfMenuPrompt(Tmp)
- Menus[MenuPtr].MenuName = ':' + left(Tmp,X - 1)
- Tmp = mid(Tmp,X + 1,255)
- Menus[MenuPtr].YPos = value(NextWord(Tmp))
- Menus[MenuPtr].XPos = value(NextWord(Tmp))
- Menus[MenuPtr].MenuColor = value(NextWord(Tmp))
- else
- if left(NovLines[LoopIndex],1) > ' '
- CommandPtr = 0
- ChoicePtr = ChoicePtr + 1
- Trim(NovLines[LoopIndex])
- if Mid(NovLines[LoopIndex], 2, 1) = '.'
- Delete(NovLines[LoopIndex],1,2)
- Trim(NovLines[LoopIndex])
- endif
- Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceName = NovLines[LoopIndex]
- else
- if ChoicePtr = 0
- Writeln
- Writeln 'Error in menu line: ' LoopIndex
- ExitMenu
- endif
- CommandPtr = CommandPtr + 1
- Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd[CommandPtr] = NovLines[LoopIndex]
- endif
- endif
- endloop
- EndProc
-
- ;------ Create the Menu Choices Array
-
- Procedure WriteOutMenuChoices
- Writeln('Translating: ' + mid(Menus[MenuPtr].MenuName,2,255))
- BlankLine
- FileWriteln(Out,';------ Translating: ' + mid(Menus[MenuPtr].MenuName,2,255))
- BlankLine
- if MenuPtr > 1
- Tmp = Menus[MenuPtr].MenuName
- Tmp = DeleteSpaces(Tmp)
- FileWriteln(Out,Tmp)
- endif
- FileWriteln(Out,'Dispose Choices')
- BlankLine
- loop(NumberOfElements(Menus[MenuPtr].MenuChoices))
- FileWriteln(Out,' Choices[' + Str(LoopIndex) + '] = "' + Menus[MenuPtr].MenuChoices[LoopIndex].ChoiceName + '"')
- endloop
- BlankLine
- FileWriteln(Out,'MakeBox("' + Mid(Menus[MenuPtr].MenuName,2,255) + '",' + Str(Menus[MenuPtr].YPos) + ',' + Str(Menus[MenuPtr].XPos) + ',CenterXY)');
- BlankLine
- EndProc
-
- ;------ Create the Onkey Statements
-
- Procedure WriteOutOnkeyChoices
- loop(NumberOfElements(Menus[MenuPtr].MenuChoices))
- ChoicePtr = LoopIndex
- Tmp = Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceName
- FileWriteln(Out,'OnKey "' + Char(64 + ChoicePtr) + '"')
- loop(NumberOfElements(Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd))
- CommandPtr = LoopIndex
- Tmp = Menus[MenuPtr].MenuChoices[ChoicePtr].ChoiceCmd[CommandPtr]
- Trim(Tmp)
- if UpperCase(Tmp) = '!LOGOUT' then Tmp = '|Logoff'
- if Left(Tmp,1) = '%'
- Tmp = DeleteSpaces(Tmp)
- Tmp = '^' + Mid(Tmp,2,255)
- endif
- if (pos('@',Tmp) > 0) And (Pos('@ECHO',UpperCase(Tmp)) = 0)
- X = 1
- while X <= length(Tmp)
- while (X <= length(Tmp)) and (mid(Tmp,X,1) <> '@')
- X = X + 1
- endwhile
- Z[1] = mid(Tmp,X,1)
- Z[2] = mid(Tmp,X + 1,1)
- if (Z[1] = '@') and (((Z[2] > '0') and (Z[3] <= '9')) or (Z[2] = '"'))
- if Z[2] = '"'
- insert(' ',Tmp,X + 1)
- VarNum = 10
- else
- VarNum = ord(Z[2]) - 48
- endif
- InputAVar = mid(Tmp,X + 2,1) = '"'
- if InputAVar
- Y = X + 3
- while (mid(Tmp,Y,1) <> '"') and (Y <= length(Tmp))
- Y = Y + 1
- endwhile
- PromptLine = mid(Tmp,X + 3,Y - (X + 3))
- else
- Y = X + 1
- endif
- delete(Tmp,X,Y - X + 1)
- insert('%NovVar' + Str(VarNum) ,Tmp,X)
- if InputAVar
- FileWriteln(Out,' |%NovVar',Str(VarNum), ' = ReadTextLine("' + PromptLine + '")')
- endif
- endif
- endwhile
- endif
- FileWriteln(Out,' ' + Tmp)
- endloop
- BlankLine
- endloop
- EndProc
-
- ;------ Create the Menus
-
- Procedure WriteOutMenus
- Var LoopCount
- Writeln
- LoopCount = MenuPtr
- loop(LoopCount)
- MenuPtr = LoopIndex
- WriteOutMenuChoices
- WriteOutOnkeyChoices
- if MenuPtr = 1
- FileWriteln(Out,'OnKey ESC')
- FileWriteln(Out,' ^Leave')
- BlankLine
- endif
- endloop
- EndProc
-
- ;------ Create the support procedures
-
- Procedure WriteOutProcedures
- BlankLine
- FileWriteln(Out,'Comment')
- FileWriteln(Out,'=================================')
- BlankLine
- FileWriteln(Out,'Here are the support subroutines.')
- BlankLine
- FileWriteln(Out,'=================================')
- FileWriteln(Out,'EndComment')
- BlankLine
- BlankLine
- FileWriteln(Out,';------ Read a Text Line Procedure')
- BlankLine
- FileWriteln(Out,'Procedure ReadTextLine(St)')
- FileWriteln(Out,'var AnswerLine')
- FileWriteln(Out,' Dispose Choices')
- FileWriteln(Out,' Choices[1] = "" ')
- FileWriteln(Out,' MakeBox("User Input",21,0,CenterXY)')
- FileWriteln(Out,' Write " " St " "')
- FileWriteln(Out,' TextColor(MenuCapColorFG,MenuBG)')
- FileWriteln(Out,' AnswerLine = Readln')
- FileWriteln(Out,' EraseTopWindow')
- FileWriteln(Out,' Return AnswerLine ')
- FileWriteln(Out,'EndProc')
- BlankLine
- FileWriteln(Out,';------ MenuExit Procedure')
- BlankLine
- FileWriteln(Out,':Leave')
- FileWriteln(Out,' Explode On')
- FileWriteln(Out,' DoubleLineBox')
- FileWriteln(Out,' DrawBox ScreenWidth / 2 - 4 ScreenHeight / 2 - 1 13 6')
- FileWriteln(Out,' TextColor LCyan Blue')
- FileWriteln(Out,' WriteCenter "Exit Menu"')
- FileWriteln(Out,' TextColor LGreen Blue')
- FileWriteln(Out,' Writeln')
- FileWriteln(Out,' ClearLine 196')
- FileWriteln(Out,' GotoXY 2 2')
- FileWriteln(Out,' WriteVertical mid(VertLine,1,3)')
- FileWriteln(Out,' Explode Off')
- FileWriteln(Out,' NoBoxBorder')
- FileWriteln(Out,' Window ScreenWidth / 2 - 1 ScreenHeight / 2 + 2 9 2')
- FileWriteln(Out,' CapsColor(MenuCapColorFG,MenuBG)')
- FileWriteln(Out,' Writeln " Yes"')
- FileWriteln(Out,' Write " No"')
- FileWriteln(Out,' DoubleLineBox')
- FileWriteln(Out,' OnKey "Y"')
- FileWriteln(Out,' |ExitMenu')
- BlankLine
- FileWriteln(Out,' OnKey "N"')
- FileWriteln(Out,' |LastKey = Esc')
- BlankLine
- FileWriteln(Out,';------ This draws a menu similiar to the Novell menus')
- FileWriteln(Out,';------ An 0 for Row And/Or Col, and the menu will get centered respectifly')
- BlankLine
- FileWriteln(Out,'Procedure MakeBox(HeaderST,Row,Col,XYOrgin)')
- FileWriteln(Out,'var NumElem Height Width')
- BlankLine
- FileWriteln(Out,' Width = Length(HeaderSt)')
- FileWriteln(Out,' NumElem = NumberOfElements(Choices)')
- BlankLine
- FileWriteln(Out,' ;Get the widest element in the Choices Array')
- BlankLine
- FileWriteln(Out,' if Length(Choices[1]) > 0 ')
- FileWriteln(Out,' loop NumElem')
- FileWriteln(Out,' Trim(Choices[LoopIndex])')
- FileWriteln(Out,' Choices[LoopIndex] = " " + Char(64 + LoopIndex) + ". " + Choices[LoopIndex]')
- FileWriteln(Out,' Width = Max(Width,Length(Choices[LoopIndex]))')
- FileWriteln(Out,' endloop')
- FileWriteln(Out,' else')
- FileWriteln(Out,' Width = 72 ')
- FileWriteln(Out,' endif')
- FileWriteln(Out,' Height = NumElem + 4')
- FileWriteln(Out,' Width = Width + 5')
- FileWriteln(Out,' if XYOrgin = CenterXY')
- FileWriteln(Out,' if Row = 0')
- BlankLine
- FileWriteln(Out,' ;Center window verticaly')
- BlankLine
- FileWriteln(Out,' Row = ((ScreenHeight - Height) / 2) + 2')
- FileWriteln(Out,' else')
- BlankLine
- FileWriteln(Out,' ;Center window with X Coordinate')
- BlankLine
- FileWriteln(Out,' Row = (Row - (Height / 2) + 1)')
- FileWriteln(Out,' endif')
- FileWriteln(Out,' if Col = 0')
- BlankLine
- FileWriteln(Out,' ;Center window horizonitly')
- BlankLine
- FileWriteln(Out,' Col = (ScreenWidth - Width) / 2')
- FileWriteln(Out,' else')
- BlankLine
- FileWriteln(Out,' ;Center window with Y Coordinate')
- BlankLine
- FileWriteln(Out,' Col = (Col - (Width / 2) + 1)')
- FileWriteln(Out,' endif')
- FileWriteln(Out,' endif')
- BlankLine
- FileWriteln(Out,' ;Make Sure Row and Col are within their range')
- BlankLine
- FileWriteln(Out,' while Row <= 4')
- FileWriteln(Out,' Row = Row + 1')
- FileWriteln(Out,' endwhile')
- BlankLine
- FileWriteln(Out,' while ((Row + Height) > (ScreenHeight - 1))')
- FileWriteln(Out,' Row = Row - 1')
- FileWriteln(Out,' endwhile')
- BlankLine
- FileWriteln(Out,' while Col <= 1')
- FileWriteln(Out,' Col = Col + 1')
- FileWriteln(Out,' endwhile')
- BlankLine
- FileWriteln(Out,' while ((Col + Width) > ScreenWidth)')
- FileWriteln(Out,' Col = Col - 1')
- FileWriteln(Out,' endwhile')
- BlankLine
- FileWriteln(Out,' CreateXYBox(Col,Row,Width,Height,HeaderSt,NumElem)')
- FileWriteln(Out,'EndProc')
- BlankLine
- BlankLine
- FileWriteln(Out,';------ Draw the Box')
- BlankLine
- FileWriteln(Out,'Procedure CreateXYBox(Col,Row,Width,Height,HeaderSt,NumElem)')
- BlankLine
- FileWriteln(Out,' ;Draw the main window')
- BlankLine
- FileWriteln(Out,' Explode On')
- FileWriteln(Out,' DoubleLineBox')
- FileWriteln(Out,' InactiveBox SingleLineBox')
- FileWriteln(Out,' BoxInsideColor(MenuInsideFG,MenuBG)')
- FileWriteln(Out,' BoxBorderColor(MenuBorderFG,MenuBG)')
- FileWriteln(Out,' DrawBox(Col, Row, Width, Height)')
- BlankLine
- FileWriteln(Out,' ;Write the header')
- BlankLine
- FileWriteln(Out,' TextColor(MenuHeaderFG,MenuBG)')
- FileWriteln(Out,' WriteCenter(HeaderSt)')
- BlankLine
- FileWriteln(Out,' ;Write the vertical lines')
- BlankLine
- FileWriteln(Out,' TextColor(MenuVertLinesFG,MenuBG)')
- FileWriteln(Out,' Writeln')
- FileWriteln(Out,' ClearLine 196')
- FileWriteln(Out,' GotoXY 2 2')
- FileWriteln(Out,' WriteVertical mid(VertLine,1,Height - 3)')
- BlankLine
- FileWriteln(Out,' ;Draw the menu text box')
- BlankLine
- FileWriteln(Out,' if Choices[1] > "" ')
- FileWriteln(Out,' CapsColor(MenuCapColorFG,MenuBG)')
- FileWriteln(Out,' else')
- FileWriteln(Out,' CapsColor(Black,Black) ')
- FileWriteln(Out,' endif')
- FileWriteln(Out,' InverseColor(MenuInverseFG,MenuInverseBG)')
- FileWriteln(Out,' Explode Off')
- FileWriteln(Out,' NoBoxBorder')
- FileWriteln(Out,' Window(Col + 3, Row + 3, Width - 4, Height - 4)')
- BlankLine
- FileWriteln(Out,' ;Write the menu choices')
- BlankLine
- FileWriteln(Out,' loop(NumElem - 1)')
- FileWriteln(Out,' Writeln(Choices[LoopIndex])')
- FileWriteln(Out,' endloop')
- BlankLine
- FileWriteln(Out,' Write Choices[NumElem]')
- FileWriteln(Out,' UseArrows On')
- FileWriteln(Out,'EndProc ')
- FileClose(Out)
- EndProc